import 'package:flutter_taotaoshipin/generated/json/base/json_convert_content.dart';
import 'package:flutter_taotaoshipin/model/drama_flower_entity.dart';

DramaFlowerEntity $DramaFlowerEntityFromJson(Map<String, dynamic> json) {
  final DramaFlowerEntity dramaFlowerEntity = DramaFlowerEntity();
  final int? id = jsonConvert.convert<int>(json['id']);
  if (id != null) {
    dramaFlowerEntity.id = id;
  }
  final int? chnId = jsonConvert.convert<int>(json['chn_id']);
  if (chnId != null) {
    dramaFlowerEntity.chnId = chnId;
  }
  final int? dramaId = jsonConvert.convert<int>(json['drama_id']);
  if (dramaId != null) {
    dramaFlowerEntity.dramaId = dramaId;
  }
  final String? aliasTitle = jsonConvert.convert<String>(json['alias_title']);
  if (aliasTitle != null) {
    dramaFlowerEntity.aliasTitle = aliasTitle;
  }
  final int? sort = jsonConvert.convert<int>(json['sort']);
  if (sort != null) {
    dramaFlowerEntity.sort = sort;
  }
  final int? tpl = jsonConvert.convert<int>(json['tpl']);
  if (tpl != null) {
    dramaFlowerEntity.tpl = tpl;
  }
  final int? ctime = jsonConvert.convert<int>(json['ctime']);
  if (ctime != null) {
    dramaFlowerEntity.ctime = ctime;
  }
  return dramaFlowerEntity;
}

Map<String, dynamic> $DramaFlowerEntityToJson(DramaFlowerEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['chn_id'] = entity.chnId;
  data['drama_id'] = entity.dramaId;
  data['alias_title'] = entity.aliasTitle;
  data['sort'] = entity.sort;
  data['tpl'] = entity.tpl;
  data['ctime'] = entity.ctime;
  return data;
}

extension DramaFlowerEntityExtension on DramaFlowerEntity {
  DramaFlowerEntity copyWith({
    int? id,
    int? chnId,
    int? dramaId,
    String? aliasTitle,
    int? sort,
    int? tpl,
    int? ctime,
  }) {
    return DramaFlowerEntity()
      ..id = id ?? this.id
      ..chnId = chnId ?? this.chnId
      ..dramaId = dramaId ?? this.dramaId
      ..aliasTitle = aliasTitle ?? this.aliasTitle
      ..sort = sort ?? this.sort
      ..tpl = tpl ?? this.tpl
      ..ctime = ctime ?? this.ctime;
  }
}